home *** CD-ROM | disk | FTP | other *** search
- /* StopXPP.c
-
- This is a the StopXPP DCMD to close all open ASP sessions that is
- compatible with AppleTalk version 55 and above.
-
- Copyright © 1991 Apple Computer, Inc. All rights reserved.
-
- Modification history:
- 08/04/91 mbs written from drvr.c
-
- The following MPW commands will build the dcmd and copy it to the
- "Debugger Prefs" file in the System folder. The dcmd's name in
- MacsBug will be the name of the file built by the Linker.
- You must first copy dcmd.h, Put.c.o, dcmdGlue.a.o and DRunTime.o from the
- C Samples folder into this folder.
-
- C -i "{AIncludes}" -r -b2 StopXPP.c
- Link dcmdGlue.a.o StopXpp.c.o put.c.o DRuntime.o ∂
- "{Libraries}"Interface.o -o StopXPP
- BuildDcmd StopXPP 1005
- Echo 'include "StopXPP";' | Rez -a -o "{systemFolder}Debugger Prefs"
- */
-
- #ifdef USESTDIO
- #include <stdio.h>
- #endif
-
- #include <Types.h>
- #include <Memory.h>
- #include <Devices.h>
- #include <SysEqu.h>
- #include <AppleTalk.h>
-
- #include "dcmd.h"
- #include "put.h"
-
- static XPPPrmBlk XPPPB;
-
-
- pascal void CommandEntry(dcmdBlock* paramPtr)
- {
- OSErr err;
-
- switch (paramPtr->request)
- {
- case dcmdInit:
- XPPPB.ioResult = 0; // Pre-load Param block
- XPPPB.ioRefNum = xppRefNum;
- XPPPB.csCode = closeAll;
- XPPPB.ioCompletion = 0;
- break;
-
- case dcmdHelp:
- dcmdDrawLine("\pStopXPP");
- dcmdDrawLine("\p Closes any open file server connections.");
- break;
-
- case dcmdDoIt:
- if (XPPPB.ioResult > 0)
- {
- dcmdDrawLine("\pStopXPP dcmd already in progress.");
- }
- else
- {
- PutPStr("\pIssuing ACloseAll to .XPP");
- err = PBControl((ParmBlkPtr)&XPPPB, 1);
- if (err)
- {
- PutPStr("\p. Error returned was ");
- PutUDec(err);
- }
- PutLine();
- }
- break;
-
- default:
- PutPStr("\pUnknown request ");
- PutUDec(paramPtr->request);
- PutLine();
- break;
- }
- } // CommandEntry
-